Repository navigation
fix(quota-gatherer): install the OpenChamber lib checkout's declared dependencies before importing it (#8759) - #8764
Conversation
…dependencies before importing it (#8759) The OpenDesign keeper imports from a plain-clone OpenChamber lib checkout; when the checkout was refreshed without an install step it had no node_modules, so every tick failed-soft with Cannot find package yaml while reporting healthy. A new lib-deps preflight (src/lib-deps.ts) checks every package declared in the manifests on the lib path resolves from the lib dir, installs the checkout's declared dependencies once at the root when any are missing, and re-checks — throwing an explicit error naming still-missing packages instead of a silent failed-soft. Preflight, not import-retry: Bun caches failed package resolution for the process (verified on bun 1.4.4). OPENCHAMBER_LIB_INSTALL_CMD overrides the install step (default bun install at the checkout root). Live remediation done with this fix: bun install --frozen-lockfile in ~/git/openchamber-quota-lib (1525 packages); the 19:37Z tick logged opendesign-renewal status=valid horizonHours=150.8 with no yaml error, 16/16 providers ok.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3786276d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { basename, dirname, join } from "node:path"; | ||
|
|
||
| const LOCKFILES = ["bun.lock", "bun.lockb", "package-lock.json", "pnpm-lock.yaml", "yarn.lock"]; | ||
| const DEPENDENCY_FIELDS = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]; |
There was a problem hiding this comment.
Exclude optional packages from mandatory dependency checks
If the lib checkout declares an optional dependency that is intentionally absent, such as a platform-specific package, this makes that absence block the OpenDesign keeper even when its actual imports would succeed. ensureLibDependencies attempts an installation and then throws when the optional package remains absent; runOpenDesignRenewal catches that error before importing or running the keeper, repeating the same failure every tick. Preserve dependency optionality rather than treating every optionalDependencies entry as a required installation postcondition.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the next commit: mandatory checks now cover only dependencies + devDependencies. optionalDependencies (e.g. packages/web's node-llama-cpp, platform-specific and intentionally absent on some installs) and peerDependencies (supplied by the consumer) are excluded from both the missing-check and the post-install postcondition, with the reason recorded in a comment at DEPENDENCY_FIELDS. Added a regression test: a checkout whose optional + peer packages are absent while its mandatory package resolves reports nothing missing and runs no install.
Fixes #8759 (queue task 15013).
Problem
Every quota-gatherer tick logged opendesign-renewal failed-soft: Cannot find package 'yaml' because the OpenChamber lib checkout named by OPENCHAMBER_LIB_DIR (~/git/openchamber-quota-lib, a plain clone) had no node_modules — its declared dependencies were never installed. The tick reported healthy while the OpenDesign renewal door was dead (since at least 2026-11-09).
Fix
Tests (oracle: bun:test)
Live verification (acceptance)
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.